<?php
require_once './functions.php';

$url = isset($_POST['url']) ? $_POST['url'] : NULL;

if(is_null($url)){
    exit("L'adresse n'a pas pu être ouverte");
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Tuto pour CURL');
$result = curl_exec($ch);
curl_close($ch);

$document = new DOMDocument();
@$document->loadHTML($result);

$info = $document->getElementById("ctl00_ctl00_BodyPlaceHolder_ContentPlaceHolderInterne_lblResult");

echo utf8_decode(get_inner_html($info));